package fuxi;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.List;

public class TestR {
	public static void main(String[] args) {
		File s=new File("d:\\练习文本.txt");
		List<Duixiang> x=new ArrayList<>();
		try {
			ObjectInputStream y=new ObjectInputStream(new FileInputStream(s));
			Duixiang z;
			do{
				try {
					z=(Duixiang) y.readObject();
					x.add(z);
				} catch (Exception e) {
					break;
				}
				
				}while(true);
				y.close();
				for (Duixiang w : x) {
					System.out.println(w.getName()+"  "+w.getClassroom()+"  "+w.getSeat());
						}
			} catch (IOException  e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				}
		
		
	}

}
